Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty resolvedScopeCodes when config cache is cleaned #9061

Merged
merged 1 commit into from
Apr 11, 2017

Conversation

andreas-wickberg-vaimo
Copy link
Contributor

@andreas-wickberg-vaimo andreas-wickberg-vaimo commented Mar 30, 2017

Also empty resolvedScopeCodes when config cache is cleaned.

Description

During setup:upgrade we change the name of the default store; magento will clean the config cache as part of saving the store view. However, ScopeCodeResolver's resolvedScopeCodes is not emptied, which means that it still maps 'stores',null to 'default', not the new name of the default store. This will break access to configurations.

Manual testing scenarios

With
/** @var \Magento\Store\Api\Data\WebsiteInterface */
protected $website;

/** @var \Magento\Store\Api\Data\GroupInterface */
protected $storeGroup;

/** @var \Magento\Store\Api\Data\StoreInterface */
protected $storeView;

we do
$this->website->getDefault();
$this->website->setCode($siteData['website']['code']);
$this->website->setName($siteData['website']['name']);
$this->website->setSortOrder($siteData['website']['sort_order']);
$this->website->setId(1);
$this->website->save();

    $this->storeGroup->load(1);
    $this->storeGroup->setName($siteData['store_group']['name']);
    $this->storeGroup->setId(1);
    $this->storeGroup->save();

    $this->storeView->load(1);
    $this->storeView->setCode($siteData['store_view']['code']);
    $this->storeView->setName($siteData['store_view']['name']);
    $this->storeView->setId(1);
    $this->storeView->save();
    $this->setLocale($siteData['store_view']['locale_code']);

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • [?] All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Mar 30, 2017

CLA assistant check
All committers have signed the CLA.

@okorshenko
Copy link
Contributor

@andreas-wickberg-vaimo thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants